package com.lujianfei.productprice.ui.addShop;

import com.lujianfei.productprice.ui.main.ShopEntity;

public class AddShopPresenter implements AddShopContract.Presenter {
    private AddShopContract.View view;
    private AddShopContract.Model model;

    public AddShopPresenter(AddShopContract.View view) {
        this.view = view;
        this.model = new AddShopModel();
    }

    @Override
    public void loadData() {
        long id = view.getId();
        ShopEntity shopEntity = model.getData(id);
        view.setData(shopEntity);
    }

    @Override
    public void save() {
        String shopName = view.getShopName();
        String remark = view.getShopRemark();
        model.save(shopName,remark);
    }
}
